﻿using UnityEngine;
using System.IO;

#if UNITY_EDITOR	
using UnityEditor;
#endif

public static class PathHelper {
	
	public static string manifestPath
	{
		get
		{
			return Path.Combine (Application.streamingAssetsPath, "assetBundle_manifest.json");
		}
	}

	public static string AssetBundlePath  
	{  
		get  
		{  
			return Path.Combine (Path.Combine (Application.streamingAssetsPath, "assetbundle"), GetPlatformName());  
		}  
	}

	public static string GetPlatformName()
	{
		#if UNITY_EDITOR
		switch (EditorUserBuildSettings.activeBuildTarget)
		{
		case BuildTarget.Android:
			return "android";
		case BuildTarget.iOS:
			return "iOS";
		case BuildTarget.StandaloneWindows:
		case BuildTarget.StandaloneWindows64:
			return "windows";
		case BuildTarget.StandaloneOSXIntel:
		case BuildTarget.StandaloneOSXIntel64:
		case BuildTarget.StandaloneOSXUniversal:
			return "macOS";
		default:
			return null;
		}
		#else
		switch(Application.platform)
		{
		case RuntimePlatform.Android:
		return "Android";
		case RuntimePlatform.IPhonePlayer:
		return "IOS";
		case RuntimePlatform.WindowsPlayer:
		return "Windows";
		case RuntimePlatform.OSXPlayer:
		return "macOS";
		default:
		return null;
		}
		#endif

	}
}
